/*
 * eventhandlertouch.cpp
 *
 *  Created on: 26 May 2012
 *      Author: hframe
 */

#include "input_handler_touchscreen.h"
#include "../application.h"

startnamespace(androidplus)
startnamespace(input)

input_handler_touchscreen::input_handler_touchscreen() {


}

input_handler_touchscreen::~input_handler_touchscreen() {

}
 void input_handler_touchscreen::handle(const AInputEvent* event){
    int32_t event_type=AInputEvent_getType(event);

    switch(event_type)
    {
    case AINPUT_EVENT_TYPE_MOTION:
     process_event_motion(event);
    	break;

    }
}
 void input_handler_touchscreen::process_event_motion(const AInputEvent *event){
	         const event::motion_event *event_ptr=new event::motion_event(event);
	    	application::cur_app()->cur_activity()->on_event_touch_move(event_ptr);
	    	delete event_ptr;
 }

endnamespace(androidplus)
endnamespace(input)
